package cn.fsd.service;

import cn.fsd.domain.Commodity;
import cn.fsd.query.delivery.CommodityClassQuery;
import cn.fsd.query.delivery.CommodityQuery;
import cn.fsd.vo.CommodityBean;
import cn.fsd.vo.PageBean;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;

public interface CommodityService {

  @Transactional
  String addCommodity(Commodity commodity);

  @Transactional
  void delCommodity(String commodityId);

  @Transactional(readOnly = true)
  CommodityBean findCommodityById(String commodityId);

  Commodity findCommodityByName(String commodityName);

  @Transactional(readOnly = true)
  List<Commodity> findAllCommodity();

  List<Commodity> findCommodityPatch(List<String> ids);

  List<Commodity> findCommodityByClass(CommodityClassQuery query);

  List<Commodity> findCommodityByCode(String code);

  @Transactional(readOnly = true)
  PageBean<Commodity> findByPage(CommodityQuery query);

  void updateCommodity(Commodity commodity);

  Commodity getTheCommodity(String id);

  List<Commodity> getCommoditiesByClass(String firstClass,String secondClass, String commodityName);
}
